#include <iostream> 
#include <cstdlib>
#include <string>
#include <ctime>
#include <deque>
using namespace std;
struct error_return
{
	unsigned int returnv;
	unsigned int number;
};

class Test
{
	unsigned int Pass,Wrong,many;
	time_t Times;
	deque<error_return> errordata;
	public:
		unsigned int (*test_run)();
		Test(unsigned int);
		string Run();
};

unsigned int runs()
{
	int i;
	for(int j = 0 ; j < 1000000;++j)
	{
		i++;
	}
	return 1;
}

int main()
{
	Test D(9);
	D.test_run = runs;
	cout << D.Run();
}

Test::Test(unsigned int Many = 1)
{
	this->many = Many;
	Pass = Wrong = 0;
	this->Times = 0;
}

inline string Tostring(unsigned int n)
{
	string tempa,tempb;
	do
	{
		tempb = tempa;
		tempa = n%10 + '0';
		tempa += tempb ;
		n/=10;
	}while(n!=0);
	return tempa;
}

string Test::Run()
{
	this->Pass = this->Wrong = 0;
	string data = "run this test now:\n";
	clock_t begin,end;
	for(unsigned int i = 1 ; i <= this->many ; ++i)
	{
		begin = clock();
		unsigned int Return = this->test_run();
		end = clock();
		this->Times += end - begin;
		if(Return != 0)
		{
			error_return temps = {Return,i};
			errordata.push_back(temps);
			data +=  string("Error run is: ")+Tostring(i);
			data += string(": ") + string("return: ") + Tostring(Return)+ string(" run time :")+Tostring(end-begin) + string("\n");
			this->Wrong += 1;
		}
		else
		{
			data +=  Tostring(i);
			data += string(": ") + string("return: ") + Tostring(Return)+ string(" run time :")+Tostring(end-begin) + string("\n");
			this->Pass += 1;
		}
	}
	data += string("run end.\nTime:")+ Tostring(Times) + string("Pass: ") + Tostring(this->Pass) + string("Wrong:") + Tostring(this->Wrong);
	return data;
}